﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 考勤信息管理
{
    public partial class addForm : Form
    {
        private Form1 _form;
        public Form1 Form { get => _form; set => _form = value; }

        public addForm(Form1 form)
        {
            InitializeComponent();
            this.Form = form;
            this.comboBoxSex.SelectedIndex = 0;

        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(this.txtID.Text);
            string name = this.txtName.Text;
            int age = Convert.ToInt32(this.txtAge.Text);
            string sex =(string) this.comboBoxSex.SelectedItem;
            //添加
            this.Form.addSE(new SE(id,name,age,sex));
            //重新绑定
            this.Form.BindingData();
            this.Close();
        }
    }
}
